<template>
	<view class="bg-white" style="height: 100vh;">
		<cu-custom bgColor="bg-gradual-orange" :isBack="true" backFlag="navigate">
			<block slot="backText">返回</block>
			<block slot="content">流量计实时数据详情</block>
		</cu-custom>
		
				<view class="padding flex flex-direction">
					<button class="cu-btn bg-green lg"  @click="openLog">历史数据</button>
				</view>
				<view class="cu-form-group">
					<view class="content">
						<text class="text-black title ">设备编号:</text>
					</view>
					<view class="action">
						<text class="text-black title ">{{myFormData.deviceNumber}}</text>
					</view>
				</view>
				
				<view class="cu-form-group">
					<view class="content">
						<text class="text-black title ">设备名称:</text>
					</view>
					<view class="action">
						<text class="text-black title ">{{myFormData.userName}}</text>
					</view>
				</view>
<!-- 				<view class="cu-form-group">
					<view class="content">
						<text class="text-black title ">流量计状态:</text>
					</view>
					<view class="action">		
						<text v-if="myFormData.flowmeterCondition=='0'" style="font-size: 1.2em; color: #19be6b;">&nbsp;在线</text>
						<text v-if="myFormData.flowmeterCondition=='1'" style="font-size: 1.2em; color: #ffaa00;">&nbsp;调试</text>
						<text v-if="myFormData.flowmeterCondition=='2'" style="font-size: 1.2em; color: #ed4014;">&nbsp;停用</text>
					</view>
				</view> -->
				<view class="cu-form-group">
					<view class="content">
						<text class="text-black title ">流量计名称:</text>
					</view>
					<view class="action">
						<text class="text-black title ">{{myFormData.collectionName}}</text>
					</view>
				</view>
				<view class="cu-form-group">
					<view class="content">
						<text class="text-black title ">经度:</text>
					</view>
					<view class="action">
						<text class="text-black title ">{{myFormData.longitude}}</text>
					</view>
				</view>
				<view class="cu-form-group">
					<view class="content">
						<text class="text-black title ">维度:</text>
					</view>
					<view class="action">
						<text class="text-black title ">{{myFormData.latitude}}</text>
					</view>
				</view>
				<view class="cu-form-group">
					<view class="content">
						<text class="text-black title ">安装位置:</text>
					</view>
					<view class="action">
						<text class="text-black title ">{{myFormData.dtuName}}</text>
					</view>
				</view>
				<view class="cu-form-group">
					<view class="content">
						<text class="text-black title ">更新时间:</text>
					</view>
					<view class="action">
						<text class="text-black title ">{{annotation.turnoverTime}}</text>
					</view>
				</view>
				
				<view class="cu-form-group">
					<view class="content">
						<text class="text-black title ">压力(Kpa):</text>
					</view>
					<view class="action">
						<text class="text-black title ">{{annotation.pressure}}</text>
					</view>
				</view>
				
				<view class="cu-form-group">
					<view class="content">
						<text class="text-black title ">流量(m³/h):</text>
					</view>
					<view class="action">
						<text class="text-black title ">{{annotation.flow}}</text>
					</view>
				</view>
				
				<view class="cu-form-group">
					<view class="content">
						<text class="text-black title ">累计气量(m³):</text>
					</view>
					<view class="action">
						<text class="text-black title ">{{annotation.cumulativeGas}}</text>
					</view>
				</view>
				
				<view class="cu-form-group">
					<view class="content">
						<text class="text-black title ">温度(℃):</text>
					</view>
					<view class="action">
						<text class="text-black title ">{{annotation.temperature}}</text>
					</view>
				</view>
				
				<view class="cu-form-group">
					<view class="content">
						<text class="text-black title ">浓度:</text>
					</view>
					<view class="action">
						<text class="text-black title ">{{annotation.concentration}}</text>
					</view>
				</view>
				
				<view class="cu-form-group">
					<view class="content">
						<text class="text-black title ">剩余量(m³):</text>
					</view>
					<view class="action">
						<text class="text-black title ">{{annotation.surplus}}</text>
					</view>
				</view>
				
				<view class="cu-form-group">
					<view class="content">
						<text class="text-black title ">工况流量:</text>
					</view>
					<view class="action">
						<text class="text-black title ">{{annotation.gongkuangLiuliang}}</text>
					</view>
				</view>
	</view>
</template>

<script>

import appSelect from '@/components/my-componets/appSelect.vue'

export default {
	components:{
		appSelect
	 },
	data(){
		return{
			NavBarColor:this.NavBarColor,
			annotation:{
				id:"",
				titile:"",
				startTime:"",
				sender:"",
				msgContent:"",
				recordVideo:"",
				workPic:"",
			},
			goodNumber:null,
			flg:true,
			src:"",
			pic:"",
			deviceId:"",
			bx_type: [
				{value:'1',text:"生产发货",},
				{value:'2',text:"未安装"},
				{value:'3',text:"已安装"},
				{value:'4',text:"故障维修"},
				{value:'5',text:"拆回"},
			] ,
			testType:'',
		}
	},

	onLoad: function (option) {
	    const annItem = JSON.parse(decodeURIComponent(option.item));
		this.annotation = annItem 
		this.myFormData = annItem 
		this.src=this.annotation.reportVideo
		this.pic=this.annotation.workPic
		this.deviceId=this.annotation.deviceId
		console.log(this.annotation.recordPic)
	},
	created(){
		console.log("created")
	},
	methods:{
		

		openLog(){
			uni.navigateTo({
				url: '/pages/cathode/flowmeterDataHis?item='+ encodeURIComponent(JSON.stringify(this.annotation))
			});
		},
		
		showVideo() {
			uni.navigateTo({
				url: '/pages/common/commonVideo?item='+this.src
			}) 
		},
		showPic() {
		    console.log(this.pic)
			uni.navigateTo({
				url: '/pages/common/commonPic?item='+this.pic
			}) 
	    }
	}
}
</script>

<style>
	
</style>
